#ifndef __GZ_INTERFACE_PARAM_SERVER_H__
#define __GZ_INTERFACE_PARAM_SERVER_H__

#include <functional>
#include <string>

namespace Gazella {

enum ParamKvMethodEnum {
    PARAM_KV_METHOD_SET = 1,
    PARAM_KV_METHOD_GET = 2,
};

//request, response
typedef std::function<bool(const std::string&, std::string&)> param_callback_t;
typedef std::function<bool(ParamKvMethodEnum, const std::string&, std::string&)> param_kv_callback_t;

class GzParamServer {
public:
    GzParamServer();
    ~GzParamServer();

    //create a param server
    [[deprecated]]
    static int create_server(
        const std::string& name,//param interface name
        param_callback_t callback,  //param request callback
        int domain = 0, //domain id, default 0
        const std::string& describe = "" //param interface describe
    );

    static int create_kv_server(
        const std::string& name,//param interface name
        param_kv_callback_t callback,  //param request callback
        int domain = 0, //domain id, default 0
        const std::string& describe = "" //param interface describe
    );

    //delete a param server
    static int delete_server(const std::string& name);
};
} //namespace Gazella

#endif